#include <Ape/Collections/CollectionHelpers.h>

namespace Ape {
	namespace Collections {
		size_t Helper::CalcAllocateSize (size_t iAtLeast, int sizeOfElement) {
			size_t iNeededSize = iAtLeast * sizeOfElement;
			size_t iAllocate = _APE_OPT_ARRAY_MIN_BYTES_ALLOCATE;
			for (iAllocate = _APE_OPT_ARRAY_MIN_BYTES_ALLOCATE; iAllocate < iNeededSize; iAllocate *= 2);
			
			return iAllocate;
		}
	}
}
